<!--申请审批页-->
<template>
  <!-- 顶部条 -->
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <span style="line-height:60px;font-size:20px;">审批列表</span>
  </div>
  <!-- 审批搜索卡片 -->
  <el-card style="margin:20px;height: 70px;">
    <el-form :inline="true">
      <el-form-item label="用车人">
        <el-input placeholder="请输入用车人" style="width:220px;"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button>重置</el-button>
        <el-button type="primary">查询</el-button>
      </el-form-item>
    </el-form>
  </el-card>
  <!-- 审批单主体 -->

  <el-row gutter="1">
     <el-col :span="6">
       <div>
         <div class="card-header" >
           <span style="font-size: 20px;"> 审批新申请</span>
         </div>
       <el-card style="overflow-y: auto;max-height: 800px">
         <span>假勤</span>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click="saveLeaveApplication">
               <div class="card-content">
                 <el-icon class="icon" style="color:rgba(255,0,98,0.62);"><UserFilled /></el-icon>
                 <div class="text">请假申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveTravelApplication">
               <div class="card-content">
                 <el-icon class="icon" style="color:rgba(0,255,157,0.63);"><HomeFilled /></el-icon>
                 <div class="text">出差申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveWorkoutApplication">
               <div class="card-content">
                 <el-icon class="icon" style="color:rgba(0,119,255,0.88);"><Ship/></el-icon>
                 <div class="text">外出申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveOvertimeApplication">
               <div class="card-content">
                 <el-icon class="icon" style="color:rgba(255,98,0,0.83);"><Platform /></el-icon>
                 <div class="text">加班申请</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <span>行政</span>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click="saveMeetingRoomReservation">
               <div class="card-content">
                 <i class="bi bi-person-video2" style="color:rgba(180,220,98,0.7);font-size: 30px"></i>
                 <div class="text">会议室预定</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveDocumentFlow">
               <div class="card-content">
                 <i class="bi bi-file-earmark-text" style="color:rgba(180,60,170,0.7);font-size: 30px"></i>
                 <div class="text">公文流转</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveRepair">
               <div class="card-content">
                 <i class="bi bi-hammer" style="color:rgba(100,60,170,0.7);font-size: 30px"></i>
                 <div class="text">物品维修</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveQualificationBorrowing">
               <div class="card-content">
                 <i class="bi bi-file-medical" style="color:rgba(100,60,10,0.7);font-size: 30px"></i>
                 <div class="text">资质借用</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click="saveSealApplication">
               <div class="card-content">
                 <i class="bi bi-joystick" style="color:rgba(255,160,140,0.7);font-size: 30px" ></i>
                 <div class="text">用章申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveVehicleApplication">
               <div class="card-content">
                 <i class="bi bi-truck-front" style="color:rgba(45,110,100,0.7);font-size: 30px"></i>
                 <div class="text">用车申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveReturnVehicle">
               <div class="card-content">
                 <i class="bi bi-truck-front-fill" style="color:rgba(145,110,100,0.7);font-size: 30px"></i>
                 <div class="text">用车归还</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <span>财务</span>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click="saveLoanApplication">
               <div class="card-content">
                 <i class="bi bi-cash-stack" style="color:rgba(255,0,250,0.7);font-size: 30px"></i>
                 <div class="text">借款申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="savePaymentApplication">
               <div class="card-content">
                 <i class="bi bi-coin" style="color:rgba(0,255,0,0.7);font-size: 30px"></i>
                 <div class="text">付款申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveRewardApplication">
               <div class="card-content">
                 <i class="bi bi-trophy" style="color:rgba(221,240,0,0.7);font-size: 30px"></i>
                 <div class="text">奖励申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="savePurchaseApplication">
               <div class="card-content">
                 <i class="bi bi-cart-plus-fill" style="color:rgba(0,145,123,0.7);font-size: 30px"></i>
                 <div class="text">采购申请</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <el-row >
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveActivityFunds">
               <div class="card-content">
                 <i class="bi bi-cash-coin"  style="color:rgba(0,0,255,0.7);font-size: 30px" ></i>
                 <div class="text">活动经费</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <span>人事</span>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click = "saveEntryApplication">
               <div class="card-content">
                 <i class="bi bi-person-workspace"  style="color:rgba(255,0,250,0.7);font-size: 30px" ></i>
                 <div class="text">入职申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveRegularizationApplication">
               <div class="card-content">
                 <i class="bi bi-person-check-fill" style="color:rgba(0,255,180,0.7);font-size: 30px"></i>
                 <div class="text">转正申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveResignationApplication">
               <div class="card-content">
                 <i class="bi bi-person-dash-fill" style="color:rgba(167,0,0,0.7);font-size: 30px"></i>
                 <div class="text">离职申请</div>
               </div>
             </el-card>
           </el-col>
           <el-col :span="6">
             <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveJobTransferApplication">
               <div class="card-content">
                 <i class="bi bi-people-fill" style="color:rgba(0,145,123,0.7);font-size: 30px"></i>
                 <div class="text">转岗申请</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
         <el-row >
         <el-col :span="6">
           <el-card class="custom-card1" style="background-color: #f9f9f9; border: 1px solid #dcdcdc; padding: 1px; border-radius: 8px;" @click="saveRecruitmentRequirement">
             <div class="card-content">
               <i class="bi bi-person-fill-add" style="color:rgba(0,45,255,0.7);font-size: 30px"  ></i>
               <div class="text">招聘需求</div>
             </div>
           </el-card>
         </el-col>
  </el-row>
         <span>其他</span>
         <el-row>
           <el-col :span="6"  >
             <el-card class="custom-card1" style="background-color:#f9f9f9; border: 1px solid #e1f3d8; padding: 1px; border-radius: 8px;" @click="saveGeneralApproval">
               <div class="card-content">
                 <el-icon class="icon" style="color:rgba(255,0,98,0.62);"><UserFilled /></el-icon>
                 <div class="text">通用审批</div>
               </div>
             </el-card>
           </el-col>
         </el-row>
       </el-card>
       </div>
      <!-- 待我审核 -->
    </el-col>
    <el-col :span="18">
      <el-card style="margin:20px;">
        <!--  审批状态项  -->
        <el-radio-group style="margin-bottom: 15px;">
          <el-radio-button value="50" size="large">全部</el-radio-button>
          <el-radio-button value="10" size="large">待我审核</el-radio-button>
          <el-radio-button value="20" size="large">待他人审核</el-radio-button>
          <el-radio-button value="30" size="large">已审核</el-radio-button>
          <el-radio-button value="40" size="large">驳回</el-radio-button>
        </el-radio-group>
        <!--  审批列表  -->
        <el-table>
          <el-table-column label="编号" prop="id" align="center" width="55" type="index"></el-table-column>
          <el-table-column label="申请人" prop="username" align="center" width="110"></el-table-column>
          <el-table-column label="申请时间" prop="startTime" align="center"></el-table-column>
          <el-table-column label="审批类型" prop="endTime"  align="center"></el-table-column>
          <el-table-column label="所属部门" prop="reason"  align="center"></el-table-column>
          <el-table-column label="审批人" prop="auditUsernameList"  align="center"></el-table-column>
          <el-table-column label="审批状态" prop="departureAddr"  align="center"></el-table-column>
          <el-table-column label="操作" width="100" align="center" v-if="type==10||type==40" :key="audit">
            <template #default="scope">
              <!-- 审批10：在待我审核页签下显示，需要当前登录用户进行审批 -->
              <el-button type="primary" link v-if="type==10">审批</el-button>
              <!-- 查看40：在驳回页签下显示，可以查看已驳回申请的驳回原因 -->
              <el-button type="primary" link v-if="type==40">查看</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </el-col>

  </el-row>
  <!-- 审批/查看弹窗 -->
  <el-dialog :title="dialogTitle" v-model="auditDialogVisible">
    <el-descriptions direction="horizontal" :column="2" border>
      <el-descriptions-item label="用车人">rose</el-descriptions-item>
      <el-descriptions-item label="用车事由">物料运输</el-descriptions-item>
      <el-descriptions-item label="使用开始时间">2024-05-28 08:00:00</el-descriptions-item>
      <el-descriptions-item label="使用结束时间">2024-06-01 08:00:00</el-descriptions-item>
      <el-descriptions-item label="车辆出发地">北京市海淀区</el-descriptions-item>
      <el-descriptions-item label="车辆目的地">北京市昌平区</el-descriptions-item>
      <el-descriptions-item label="驾照图片">
        <img src="/imgs/admin/drivingLicense.png" style="width:150px;">
      </el-descriptions-item>
      <el-descriptions-item label="备注">因仓储不够，急需调用车辆进行物料运输</el-descriptions-item>
      <!--  驳回原因要在点击驳回才显示 -->
      <!--  <el-descriptions-item label="驳回原因">暂无可用车辆</el-descriptions-item> -->
    </el-descriptions>
    <template #footer>
      <el-button>取消</el-button>
      <el-button type="primary" plain>驳回</el-button>
      <el-button type="primary">通过</el-button>
    </template>
  </el-dialog>

  <!-- 弹窗 -->
  <el-dialog title="驳回 查看" :before-close="handleClose" v-model="rejectInnerDialogVisible" style="margin-top: 37vh;">
    <el-descriptions direction="horizontal" border>
      <el-descriptions-item label="驳回原因">
        <el-input placeholder="请输入驳回原因"></el-input>
      </el-descriptions-item>
    </el-descriptions>
    <template #footer>
      <el-button type="primary" plain>取消</el-button>
      <el-button type="primary">确定</el-button>
    </template>
  </el-dialog>
  <el-dialog title="请假申请" :before-close="handleClose" v-model="leaveApplicationDialogVisible" style="margin-top: 15vh;">
      <el-form label-position="top" label-width="80px">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="申请人">
              <el-input readonly :value="user.username"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="部门">
              <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
                <el-option v-for="item in departmentidArr"
                           :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="请假类型">
              <el-select placeholder="请选择" v-model="saveLeaveForm.leaveType" >
                <el-option v-for="item in leaveTypeArr"
                           :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="请假天数">
              <el-input readonly :value="leaveDays"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="20">
          <el-col :span="12">
            <el-form-item label="开始时间" >
              <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                              value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束时间" >
              <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                              value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="请假事由">
              <el-input
                  type="textarea"
                  placeholder="请输入请假事由"
                  v-model="saveLeaveForm.reason"
                  :rows="3"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="24">
            <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="审核人">
              <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
                <el-option v-for="item in UserArr"
                           :label="item.username" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抄送">
              <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
                <el-option v-for="item in UserArr"
                           :label="item.username" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <el-button type="primary" plain>取消</el-button>
        <el-button type="primary">确定</el-button>
      </template>
    </el-dialog>
  <el-dialog title="出差申请" :before-close="handleClose" v-model="travelApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="请假类型">
            <el-select placeholder="请选择" v-model="saveLeaveForm.leaveType" >
              <el-option v-for="item in leaveTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="请假天数">
            <el-input readonly :value="leaveDays"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="开始时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="结束时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="出差事由">
            <el-input
                type="textarea"
                placeholder="请输入出差事由"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="外出申请" :before-close="handleClose" v-model="workoutApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="请假类型">
            <el-select placeholder="请选择" v-model="saveLeaveForm.leaveType" >
              <el-option v-for="item in leaveTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="请假天数">
            <el-input readonly :value="leaveDays"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="开始时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="结束时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="外出事由">
            <el-input
                type="textarea"
                placeholder="请输入外出事由"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="外出地点">
            <el-input placeholder="请输入外出地点" v-model="saveLeaveForm.place"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="加班申请" :before-close="handleClose" v-model="overtimeApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="请假类型">
            <el-select placeholder="请选择" v-model="saveLeaveForm.leaveType" >
              <el-option v-for="item in leaveTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="加班天数">
            <el-input readonly :value="leaveDays"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="开始时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="结束时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="加班事由">
            <el-input
                type="textarea"
                placeholder="请输入加班事由"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="加班兑换" >
           <el-select placeholder="请选择" v-model="saveLeaveForm.exchange" >
             <el-option label="加班费" value="10"></el-option>
           </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="会议室预定" :before-close="handleClose" v-model="meetingRoomReservationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="开始时间">
            <el-date-picker
                type="datetime"
                format="YYYY-MM-DD HH:mm:ss"
                value-format="YYYY-MM-DD HH:mm:ss"    style="width: 100%"
                v-model="saveLeaveForm.startDate"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="结束时间">
            <el-date-picker
                type="datetime"
                format="YYYY-MM-DD HH:mm:ss"
                value-format="YYYY-MM-DD HH:mm:ss"    style="width: 100%"
                v-model="saveLeaveForm.endDate"
            />
          </el-form-item>
        </el-col>

      </el-row>
      <el-row :gutter="10">
        <el-col >
          <el-form-item label="会议室">
            <el-select placeholder="请选择" v-model="saveLeaveForm.roomId" >
              <el-option v-for="item in roomArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入备注"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
  <el-dialog title="公文流转" :before-close="handleClose" v-model="documentFlowDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="文件名称">
            <el-input placeholder="请输入"  v-model="saveLeaveForm.fileName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="紧急程度">
            <el-select placeholder="请选择" v-model="saveLeaveForm.urgencyLevel " >
              <el-option label="普通"  value="10"></el-option>
              <el-option label="紧急"  value="20"></el-option>
              <el-option label="特急"  value="30"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="来访单位" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.visitUnit"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="来文时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.comeDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="物品维修" :before-close="handleClose" v-model="repairDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="故障设备名称">
            <el-input placeholder="请输入"  v-model="saveLeaveForm.deviceName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="紧急程度">
            <el-select placeholder="请选择" v-model="saveLeaveForm.urgencyLevel " >
              <el-option label="普通"  value="10"></el-option>
              <el-option label="紧急"  value="20"></el-option>
              <el-option label="特急"  value="30"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="预计维修费用" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.fee"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="报修日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.repairDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="资质借用" :before-close="handleClose" v-model="qualificationBorrowingDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="资质借用人">
          <el-select v-model="saveLeaveForm.borrowerId" filterable placeholder="请选择或输入借用人">
            <el-option
                v-for="item in UserArr"
                :key="item.id"
                :label="item.username"
                :value="item.id"
            />
          </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="借用人联系方式">
            <el-input placeholder="请输入"  v-model="saveLeaveForm.borrowerPhone"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="借用部门" >
            <el-select placeholder="请选择" v-model="saveLeaveForm.borrowerDepartmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="档案类型" >
            <el-select placeholder="请选择" v-model="saveLeaveForm.fileType" @change="loadUser">
              <el-option v-for="item in fileTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="所借档案用途">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="借用日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="拟归还日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="借用档案明细">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.borrowedArchiveDetails "
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note "
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="用章申请" :before-close="handleClose" v-model="sealApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="印章类型">
            <el-select placeholder="请选择" v-model="saveLeaveForm.sealType " >
              <el-option v-for="item in sealTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用印日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="文件名称" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.fee"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="文件类型" >
            <el-select placeholder="请选择" v-model="saveLeaveForm.filesType " >
              <el-option v-for="item in filesTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="用印事由">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="用车申请" :before-close="handleClose" v-model="vehicleApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="车辆选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.vehicleId" >
              <el-option v-for="item in vehicleArr" :key="item.id" :label="`${item.license} - ${item.brand} ` " :value="item.id">

              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用车天数">
            <el-input readonly :value="leaveDays"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row gutter="20">
        <el-col :span="12">
          <el-form-item label="开始时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="结束时间" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="用车事由">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="用车目的地">
            <el-input placeholder="请输入用车目的地" v-model="saveLeaveForm.place"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="用车归还" :before-close="handleClose" v-model="returnVehicleDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="归还车辆">
            <el-select placeholder="请选择" v-model="saveLeaveForm.vehicleId" >
              <el-option v-for="item in vehicleArr" :key="item.id" :label="`${item.license} - ${item.brand} ` " :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="归还日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.returnDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="借款申请" :before-close="handleClose" v-model="loanApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="借款类型">
            <el-select placeholder="请选择" v-model="saveLeaveForm.reimbursementType" >
              <el-option v-for="item in reimbursementTypeArr" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="借款金额" >
            <el-input placeholder="借款金额" v-model="saveLeaveForm.amount"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="借款人">
            <el-select placeholder="请输入" v-model="saveLeaveForm.amountUserId" >
              <el-option
                  v-for="item in UserArr"
                  :key="item.id"
                  :label="item.username"
                  :value="item.id"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="借款日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.amountDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="银行账号">
              <el-input placeholder="请输入" v-model="saveLeaveForm.bankNum"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="开户行" >
            <el-input placeholder="请输入正确开户行" v-model="saveLeaveForm.bankName"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="借款事由">
              <el-input
                  type="textarea"
                  placeholder="请输入借款事由"
                  v-model="saveLeaveForm.reason"
                  :rows="3"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="付款申请" :before-close="handleClose" v-model="paymentApplicationDialogVisible" style="margin-top: 15vh;">
  <el-form label-position="top" label-width="80px">
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="申请人">
          <el-input readonly :value="user.username"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="部门">
          <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
            <el-option v-for="item in departmentidArr"
                       :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="付款方式">
          <el-select placeholder="请选择" v-model="saveLeaveForm.paymentType" >
            <el-option v-for="item in paymentTypeArr" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="付款金额" >
          <el-input placeholder="借款金额" v-model="saveLeaveForm.payment"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="收款人全称">
          <el-input placeholder="请输入收款人全称" v-model="saveLeaveForm.paymentName"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="付款日期" >
          <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                          value-format="YYYY-MM-DD" v-model="saveLeaveForm.paymentDate"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="银行账号">
          <el-input placeholder="请输入" v-model="saveLeaveForm.bankNum"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="开户行" >
          <el-input placeholder="请输入正确开户行" v-model="saveLeaveForm.bankName"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="付款事由">
          <el-input
              type="textarea"
              placeholder="请输入付款事由"
              v-model="saveLeaveForm.reason"
              :rows="3"
          >
          </el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="24">
        <el-form-item label="流程选择">
          <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
            <el-option v-for="item in approvalTypeArr"
                       :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="12">
        <el-form-item label="审核人">
          <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
            <el-option v-for="item in UserArr"
                       :label="item.username" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="抄送">
          <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
            <el-option v-for="item in UserArr"
                       :label="item.username" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
  <template #footer>
    <el-button @click="handleClose">取消</el-button>
    <el-button type="primary" @click="saveUser">保存</el-button>
  </template>
</el-dialog>
  <el-dialog title="采购申请" :before-close="handleClose" v-model="purchaseApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="物品名称" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.purchaseName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="交付日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="采购数量" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.purchaseNum"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="采购金额" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.purchasePrice"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="奖励事由">
            <el-input
                type="textarea"
                placeholder="请输入奖励事由"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="奖励申请" :before-close="handleClose" v-model="rewardApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="奖励金额" >
            <el-input placeholder="借款金额" v-model="saveLeaveForm.payment"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="奖励日期" >
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.paymentDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="奖励事由">
            <el-input
                type="textarea"
                placeholder="请输入奖励事由"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="活动经费" :before-close="handleClose" v-model="activityFundsDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="活动名称" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.activeName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="活动预算" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.activePrice"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="活动说明">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="入职申请" :before-close="handleClose" v-model="entryApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="员工姓名">
            <el-input v-model="saveLeaveForm.entryUsername" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="入职部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="手机号码" >
            <el-input placeholder="请输入" v-model="saveLeaveForm.activeName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="入职时间">
          <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                          value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="性别" >
            <el-select v-model="saveLeaveForm.gender">
              <el-option label="男" value="1"></el-option>
              <el-option label="女" value="0"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="担任职务">
            <el-select v-model="saveLeaveForm.level">
              <el-option v-for="item in positionNameArr"
              :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="转正申请" :before-close="handleClose" v-model="regularizationApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="员工姓名">
            <el-input v-model="saveLeaveForm.entryUsername" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="所在部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="担任职务">
            <el-select v-model="saveLeaveForm.level">
              <el-option v-for="item in positionNameArr"
                         :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="转正日期">
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="试用期评价">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="离职申请" :before-close="handleClose" v-model="resignationApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="员工姓名">
            <el-input v-model="saveLeaveForm.resignationUsername" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="所在部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="担任职务">
            <el-select v-model="saveLeaveForm.level">
              <el-option v-for="item in positionNameArr"
                         :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="申请离职日期">
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.endDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="离职原因">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="转职申请" :before-close="handleClose" v-model="jobTransferApplicationDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="员工姓名">
            <el-input v-model="saveLeaveForm.jobTransferUsername" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="入职日期">
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="当前所在部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="当前担任职务">
            <el-select v-model="saveLeaveForm.level">
              <el-option v-for="item in positionNameArr"
                         :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="转岗部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.jobTransferdepartmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="转岗担任职务">
            <el-select v-model="saveLeaveForm.jobTransferlevel">
              <el-option v-for="item in positionNameArr"
                         :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>

      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="离职原因">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="招聘需求" :before-close="handleClose" v-model="recruitmentRequirementDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="招聘部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="期望到岗职日期">
            <el-date-picker type="date" format="YYYY-MM-DD" style="width: 100%"
                            value-format="YYYY-MM-DD" v-model="saveLeaveForm.startDate"/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="招聘岗位">
            <el-select v-model="saveLeaveForm.level">
              <el-option v-for="item in positionNameArr"
                         :label="item.label" :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="招聘人数">
            <el-input v-model="saveLeaveForm.Num" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="岗位职责">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.reason"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="任职要求">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
  <el-dialog title="通用审批" :before-close="handleClose" v-model="generalApprovalDialogVisible" style="margin-top: 15vh;">
    <el-form label-position="top" label-width="80px">
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="申请人">
            <el-input readonly :value="user.username"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门">
            <el-select placeholder="请选择" v-model="saveLeaveForm.departmentId" @change="loadUser">
              <el-option v-for="item in departmentidArr"
                         :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审批名称">
            <el-input placeholder="请输入"  v-model="saveLeaveForm.deviceName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="紧急程度">
            <el-select placeholder="请选择" v-model="saveLeaveForm.urgencyLevel " >
              <el-option label="普通"  value="10"></el-option>
              <el-option label="紧急"  value="20"></el-option>
              <el-option label="特急"  value="30"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
                type="textarea"
                placeholder="请输入"
                v-model="saveLeaveForm.note"
                :rows="3"
            >
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item label="流程选择">
            <el-select placeholder="请选择" v-model="saveLeaveForm.approvalType" >
              <el-option v-for="item in approvalTypeArr"
                         :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="审核人">
            <el-select placeholder="请选择" v-model="saveLeaveForm.auditName" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抄送">
            <el-select placeholder="请选择" v-model="saveLeaveForm.cc" >
              <el-option v-for="item in UserArr"
                         :label="item.username" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="handleClose">取消</el-button>
      <el-button type="primary" @click="saveUser">保存</el-button>
    </template>
  </el-dialog>
</template>

<script setup>
import {computed, onMounted, ref} from "vue";
import qs from "qs";
import axios from "axios";
import {ElMessage} from "element-plus";
const user = ref(getUser());

//处理弹窗关闭的方法
const handleClose = () => {
  if (confirm('您确认要关闭本窗口吗?')) {
    //关闭弹窗,并清空双向绑定的表单数据
    leaveApplicationDialogVisible.value = false;
    workoutApplicationDialogVisible.value = false;
    overtimeApplicationDialogVisible.value = false;
    meetingRoomReservationDialogVisible.value = false;
    documentFlowDialogVisible.value = false;
    repairDialogVisible.value = false;
    qualificationBorrowingDialogVisible.value = false;
    travelApplicationDialogVisible.value = false;
    leaveApplicationDialogVisible.value = false;
    leaveApplicationDialogVisible.value = false;
    sealApplicationDialogVisible.value = false;
    vehicleApplicationDialogVisible.value=false;
    returnVehicleDialogVisible.value = false;
    loanApplicationDialogVisible.value=false;
    paymentApplicationDialogVisible.value=false;
    rewardApplicationDialogVisible.value = false;
    purchaseApplicationDialogVisible.value = false;
    activityFundsDialogVisible.value=false;
    entryApplicationDialogVisible.value = false;
    regularizationApplicationDialogVisible.value= false;
    resignationApplicationDialogVisible.value = false;
    jobTransferApplicationDialogVisible.value = false;
    recruitmentRequirementDialogVisible.value = false;
    generalApprovalDialogVisible.value= false
  }
}
//控制审批弹窗标题
const dialogTitle = ref("待审批详情");
//控制审批弹窗是否显示
const auditDialogVisible = ref(false);
//控制驳回原因弹窗是否显示
const rejectInnerDialogVisible = ref(false);
//请假申请弹窗
const leaveApplicationDialogVisible = ref(false);
const workoutApplicationDialogVisible= ref(false);
const overtimeApplicationDialogVisible = ref(false);
const meetingRoomReservationDialogVisible = ref(false);
const documentFlowDialogVisible = ref(false);
const travelApplicationDialogVisible = ref(false);
const repairDialogVisible = ref(false);
const qualificationBorrowingDialogVisible = ref(false);
const sealApplicationDialogVisible = ref(false);
const vehicleApplicationDialogVisible = ref(false);
const returnVehicleDialogVisible = ref(false);
const loanApplicationDialogVisible = ref(false);
const paymentApplicationDialogVisible = ref(false);
const rewardApplicationDialogVisible = ref(false);
const purchaseApplicationDialogVisible = ref(false);
const activityFundsDialogVisible = ref(false);
const entryApplicationDialogVisible = ref(false);
const regularizationApplicationDialogVisible = ref(false);
const resignationApplicationDialogVisible = ref(false);
const jobTransferApplicationDialogVisible = ref(false);
const recruitmentRequirementDialogVisible = ref(false);
const generalApprovalDialogVisible = ref (false);

const saveLeaveForm = ref({
  startDate: '',
  endDate: '',
  username:user.value.username,
});

// 计算请假天数
const leaveDays = computed(() => {
  if (saveLeaveForm.value.startDate && saveLeaveForm.value.endDate) {
    const start = new Date(saveLeaveForm.value.startDate);
    const end = new Date(saveLeaveForm.value.endDate);
    const timeDifference = end.getTime() - start.getTime();
    const daysDifference = timeDifference / (1000 * 3600 * 24);
    return daysDifference + 1; // 包括开始和结束当天
  }
  return 0;
});
//请假申请
const saveLeaveApplication = () => {
  leaveApplicationDialogVisible.value = true;
}
//出差申请
const saveTravelApplication = () => {
  travelApplicationDialogVisible.value = true;

}
//外出申请
const saveWorkoutApplication = () => {
  workoutApplicationDialogVisible.value = true;
}
//加班申请
const saveOvertimeApplication = () => {
  overtimeApplicationDialogVisible.value = true;
}
//会议室预定
const saveMeetingRoomReservation = () => {
  meetingRoomReservationDialogVisible.value = true;
}
//公文流转
const saveDocumentFlow = () => {
  documentFlowDialogVisible.value = true;
}
//物品维修
const saveRepair = () => {
  repairDialogVisible.value = true;
}
//资质借用
const saveQualificationBorrowing = () => {
  qualificationBorrowingDialogVisible.value = true;
}
//用章申请
const saveSealApplication = () => {
  sealApplicationDialogVisible.value = true;
}
//用车申请
const saveVehicleApplication = () => {
  vehicleApplicationDialogVisible.value = true;
}
//用车归还
const saveReturnVehicle = () => {
  returnVehicleDialogVisible.value = true;
}
//借款申请
const saveLoanApplication = () => {
  loanApplicationDialogVisible.value = true;
}
//付款申请
const savePaymentApplication = () => {
  paymentApplicationDialogVisible.value = true;
}
//奖励申请
const saveRewardApplication = () => {
  rewardApplicationDialogVisible.value = true;
}
//采购申请
const savePurchaseApplication = () => {
  purchaseApplicationDialogVisible.value = true;
}
//活动经费
const saveActivityFunds= () =>{
  activityFundsDialogVisible.value = true
}
//入职申请
const saveEntryApplication = ()=>{
  entryApplicationDialogVisible.value = true
}
//转正申请
const saveRegularizationApplication = ()=>{
  regularizationApplicationDialogVisible.value = true
}
//离职申请
const saveResignationApplication = ()=>{
  resignationApplicationDialogVisible.value = true
}
//转职申请
const saveJobTransferApplication = ()=>{
  jobTransferApplicationDialogVisible.value = true
}
//招聘需求
const saveRecruitmentRequirement = ()=>{
  recruitmentRequirementDialogVisible.value = true
}
//通用审批
const saveGeneralApproval = ()=>{
  generalApprovalDialogVisible.value = true
}



 const searchUserForm = ref({
  employeeType: '',
  username: ''
});
//定义对象保存查询到的表格数据
const UserArr = ref([]);
//定义加载用户的方法
const loadUser = () => {
  let data = qs.stringify(searchUserForm.value);//username=tom&status=1
  //如果有查询条件,就根据后面拼接的条件查,没有条件默认加载所有用户数据
  axios.get(BASE_URL + '/oa1/user/select?' + data)
      .then((response) => {//回调函数中处理响应结果
        if (response.data.code == 2000) {
          UserArr.value = response.data.data;//将后端响应数据装入用户数组中
          console.log(UserArr.value);
        } else {
          ElMessage.error(response.data.msg);
        }
      })
}
const leaveTypeArr= ref([]);
const leaveTypeFormatter = (row,column,cellValue,index)=>{
  if(!leaveTypeArr.value){
    return cellValue;
  }
  for(let item of leaveTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const approvalTypeArr= ref([]);
const approvalTypeFormatter = (row,column,cellValue,index)=>{
  if(!approvalTypeArr.value){
    return cellValue;
  }
  for(let item of approvalTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const fileTypeArr= ref([]);
const fileTypeFormatter = (row,column,cellValue,index)=>{
  if(!fileTypeArr.value){
    return cellValue;
  }
  for(let item of fileTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const filesTypeArr= ref([]);
const filesTypeFormatter = (row,column,cellValue,index)=>{
  if(!filesTypeArr.value){
    return cellValue;
  }
  for(let item of filesTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const sealTypeArr= ref([]);
const sealTypeFormatter = (row,column,cellValue,index)=>{
  if(!sealTypeArr.value){
    return cellValue;
  }
  for(let item of sealTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const reimbursementTypeArr= ref([]);
const reimbursementTypeFormatter = (row,column,cellValue,index)=>{
  if(!reimbursementTypeArr.value){
    return cellValue;
  }
  for(let item of reimbursementTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const paymentTypeArr= ref([]);
const paymentTypeFormatter = (row,column,cellValue,index)=>{
  if(!paymentTypeArr.value){
    return cellValue;
  }
  for(let item of paymentTypeArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
const positionNameArr= ref([]);
const positionNameTypeFormatter = (row,column,cellValue,index)=>{
  if(!positionNameArr.value){
    return cellValue;
  }
  for(let item of positionNameArr.value){
    if(item.value == cellValue){
      cellValue = item.label;
    }
  }
  return cellValue;
}
  onMounted(()=>{
  loadDictOption(leaveTypeArr,'leave_type');
  loadDictOption(approvalTypeArr,'approval_process_type');
  loadDepartment();
  loadUser();
  loadDictOption(fileTypeArr,'file_type');
  loadDictOption(filesTypeArr,'files_type');
  loadDictOption(sealTypeArr,'seal_type');
  loadDictOption(reimbursementTypeArr,'reimbursement_type');
  loadDictOption(paymentTypeArr,'payment_type');
  loadDictOption(positionNameArr,'position_name');
  loadVehicle();
})
const searchDepartment = ref({
});
const departmentidArr = ref([]);
const loadDepartment = ()=>{
  let data = qs.stringify(searchDepartment.value);//username=tom&status=1
  //如果有查询条件,就根据后面拼接的条件查,没有条件默认加载所有用户数据
  axios.get(BASE_URL+'/oa1/department/select?'+data)
      .then((response)=>{//回调函数中处理响应结果
        if(response.data.code == 2000){
          departmentidArr.value = response.data.data;//将后端响应数据装入用户数组中
          console.log(departmentidArr.value);
        }else{
          ElMessage.error(response.data.msg);
        }
      })
}
const vehicleArr = ref([]);
//定义加载车辆的方法
const loadVehicle = ()=>{
  axios.get(BASE_URL+'/oa1/vehicle/select').then((response)=>{
    if(response.data.code == 2000){
      vehicleArr.value = response.data.data;
    }else{
      ElMessage.error(response.data.msg);
    }
  })
}

</script>

<style>
.card-content {
  text-align: center;
}
.icon {
  font-size: 30px; /* 调整图标的大小 */
  margin-bottom: 1px; /* 图标和文字之间的间距 */
}

.text {
  font-size: 12px; /* 调整文字的大小 */
}
.custom-card1 {
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 85px;
  width: 85px;
  margin:5px;
  white-space: nowrap;
}

.custom-card1:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
</style>